package l.l.w.practice.GenerateSilverCoin;

import java.util.Scanner;

/**
 * Created by llw on 2017/10/3.
 */
public class GenerateSilverCoin {

    public String generateSliverCoin(int num){
        StringBuilder sb = new StringBuilder();
        while(num != 0){
            if((num & 1) ==0) {//偶数
                num = (num-2)>>>1;
                sb.append("2");
            }else{
                num = (num-1)>>>1;
                sb.append("1");
            }
        }
        return sb.reverse().toString();
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        Integer num = Integer.valueOf(s);
        String result = new GenerateSilverCoin().generateSliverCoin(num);
        System.out.println(result);
    }
}
